package com.edu.cdp.service;

import com.edu.cdp.DTO.AddGoodsDTO;
import com.edu.cdp.DTO.PageDTO;
import com.edu.cdp.DTO.UpdateGoodDTO;
import com.edu.cdp.common.PageResult;
import com.edu.cdp.domain.Goods;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
* @author Yang Can
* @description 针对表【goods】的数据库操作Service
* @createDate 2024-05-30 10:20:26
*/
public interface GoodsService extends IService<Goods> {
    Goods newUpdate(UpdateGoodDTO goods, MultipartFile file);
    Goods add(AddGoodsDTO goods, MultipartFile file);
    List<Goods> listByTypeId(Integer id);

    List<Goods> selectByStock(Integer quantity);

    List<Goods> listByName(String name);

    List<Goods> selectByStockAmple(Integer quantity);

    PageResult pageQuery(PageDTO goodsPageDTO);

    Goods selectByCategoryId(Integer category);

    Goods addStock(Integer id, Integer quantity);
}
